﻿using System.Collections.Generic;
using Engine;

namespace Game
{
    public class jlx : SixFaceBlock
    {
        public const int Index = 339;

        public Random m_random = new Random();

        public jlx()
            : base("Textures/mineral/jlx", Color.White)
        {
        }

        public override string GetDescription(int value)
        {
            return "这是一个奖励方块，通常生成在村庄里面，将其击碎可以得到你想要的东西。";
        }

        public override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List<BlockDropValue> dropValues, out bool showDebris)
        {
            if (m_random.Bool(1f))
            {
                dropValues.Add(new BlockDropValue
                {
                    Value = new Random().Int(1, 360),
                    Count = 1
                });
                showDebris = true;
            }
            else
            {
                base.GetDropValues(subsystemTerrain, oldValue, newValue, toolLevel, dropValues, out showDebris);
            }
        }

        public override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength)
        {
            return new BlockDebrisParticleSystem(subsystemTerrain, position, 1f * strength, DestructionDebrisScale, Color.White, DefaultTextureSlot);
        }

        public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
        {
            return "奖励方块";
        }
    }
}